<?php

$GLOBALS['this_copy'] = $this;

function foreachrec($recVal) {
	echo '<ul>';
	foreach($recVal as $key => $val) {
		echo '<li>';
		echo link_to(ucfirst($key), array('action' => 'productList', 'type' => $key));
		if (is_array($val)) { foreachrec($val); }
		echo '</li>';
	}
	echo '</ul>';
}

?>